package cn.demo.gecco.geccobean;

import com.geccocrawler.gecco.annotation.Href;
import com.geccocrawler.gecco.annotation.HtmlField;
import com.geccocrawler.gecco.annotation.Image;
import com.geccocrawler.gecco.annotation.Text;
import com.geccocrawler.gecco.spider.HtmlBean;

/**
 * @ClassName:  HouseInfo
 * @PackageName: cn.demo.gecco.geccobean
 * @author: youjp
 * @create: 2019-11-06 14:01
 * @description: TODO 房屋信息
 * @Version: 1.0
 */
public class HouseInfo  implements HtmlBean {


    /**
     * 标题
     */
    @Text
    @HtmlField(cssPath = "div.house-details > div.house-title > a")
    private String housName;

    /**
     * 价格
     */
    @Text
    @HtmlField(cssPath = "div.pro-price > span.price-det > strong")
    private String price;

    /**
     * 每平方
     */
    @Text
    @HtmlField(cssPath = " div.pro-price > span.unit-price")
    private String perSquare;


    /**
     * 住房类型
     */
    @Text
    @HtmlField(cssPath = "div.house-details > div:nth-child(2) > span:nth-child(1)")
    private String type;


    /**
     * 房屋大小
     */
    @Text
    @HtmlField(cssPath = " div.house-details > div:nth-child(2) > span:nth-child(3)")
    private String size;

    /**
     * 地址
     */
    @Text
    @HtmlField(cssPath = "div.house-details > div:nth-child(3) > span")
    private String address;


    @Href
    @HtmlField(cssPath = "div.house-title > a")
    private String url;


    @HtmlField(cssPath = "div.item-img > img")
    @Image
    private String image;

    public String getHousName() {
        return housName;
    }

    public void setHousName(String housName) {
        this.housName = housName;
    }

    public String getPrice() {
        return price+"万";
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getPerSquare() {
        return perSquare;
    }

    public void setPerSquare(String perSquare) {
        this.perSquare = perSquare;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    @Override
    public String toString() {
        return "HouseInfo{" +
                "housName='" + housName + '\'' +
                ", price='" + price + '\'' +
                ", perSquare='" + perSquare + '\'' +
                ", type='" + type + '\'' +
                ", size='" + size + '\'' +
                ", address='" + address + '\'' +
                ", url='" + url + '\'' +
                ", image='" + image + '\'' +
                '}';
    }
}
